<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>nav</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <style>
        html,body {
        height: 4.4rem;
    }
    .menu{font-size: 1rem;color: #fff;width: 35px;height: 35px;display: inline-block;text-align: center;font-weight: bold;}
    #jb, .jb{background: white}
    .menu {text-align: center;}
    .menu img{width: 0.9rem;display: inline-block;margin-top: 0.55rem;}
    </style>
</head>

<body class="jb" style="border-top: 1px solid #eee;">
    <div class="aui-pull-right"><span class="menu">
      <!-- <i class="aui-iconfont aui-icon-menu" onclick="goToSuper()" style="color:#FE417A"></i> -->
      <img src="../image/newImg/more@3x.png" alt="" onclick="goToSuper()">
    </span></div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="./script/judge.js" ></script>
<script type="text/javascript">
    var NVNavigationBar;
    apiready = function () {
        NVNavigationBar = api.require('NVNavigationBar');
        var items = [{
            title: '全部',
            bg: 'rgba(255,255,255,0)'
        }];
        _Ajax(window.APIServer.Section, 'post', {
            values: {
                type: 1
            }
        }, 'json', function (ret) {
            //.渲染页面
            var section_ids = [0];
            if (ret.code == 1) {
                var i = 1;
                $(ret.data).each(function (k, v) {
                    items.push({
                        title: v.name,
                        bg: 'rgba(255,255,255,0)'
                    });
                    section_ids[i] = v.id;
                    i++;
                });
                _SetPrefs('section_ids', JSON.stringify(section_ids));
            }
            NVNavigationBar_open(items);
        });
    };

    function goToSuper() {
        api.openWin({
            name: 'super_class_win',
            url: './super_class_win.html',
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: 'auto'
            }
        });
    }

    function NVNavigationBar_open(items) {
        NVNavigationBar.open({
            rect: {
                x: 0,
                y: 0,
                w: api.frameWidth - 42,
                h: 42
            },
            styles: {
                orientation: 'horizontal',
                bg: 'rgba(255,255,255,0)',
                bgAlpha: 1,
                font: {
                    size: 15,
                    sizeSelected: 15,
                    color: '#333333',
                    colorSelected: '#FE417A'
                },
                itemSize: {
                    w: 50,
                    h: 42
                }
            },
            items: items,
            selectedIndex: 0,
            fixedOn: api.frameName,
            fixed: true,
            id: 'first'
        }, function (ret, err) {
            if (ret.eventType == 'click') {
                var ids = JSON.parse(_GetPrefs('section_ids'));
                var id = ids[ret.index];
                api.execScript({
                    name: 'root',
                    frameName: 'index_frm',
                    script: 'getData(' + id + ',true);'
                });
            }
        });
    }

    function fnNvnsetSelected(index) {
        var NVNavigationBar = api.require('NVNavigationBar');
        NVNavigationBar.setSelected({
            id: 'first',
            index: index,
            selected: true
        }, function (ret) {

        });
    }

    function hide() {
        NVNavigationBar.hide({
            id: 'first'
        });
    }
</script>

</html>
